<?php

include("include/session.php");
?>

<html>
<body>

<table>
<tr>
  <td>


<?php

if($session->logged_in){
     echo '<h1>Zalogowany!</h1>';
   
   echo "Witaj <b>$session->username</b>, jestes zalogowany!. <br><br>"
       ."[<a href=\"userinfo.php?user=$session->username\">Moje konto</a>] &nbsp;&nbsp;"
       ."[<a href=\"useredit.php\">Edytuj konto</a>] &nbsp;&nbsp;";
  
   echo "[<a href=\"process.php\">Wyloguj</a>]";
}
else{
?>

<h1>Login</h1>
<?php

if($form->num_errors > 0){
   echo "<font size=\"2\" color=\"#ff0000\">".$form->num_errors." Znalezione bledy</font>";
}
?>
<form action="process.php" method="POST">
<table align="left" border="0" cellspacing="0" cellpadding="3">
<tr><td>Login:</td><td><input type="text" name="user" maxlength="30" value="<?php echo $form->value("user"); ?>"></td><td><?php echo $form->error("user"); ?></td></tr>
<tr><td>Haslo:</td><td><input type="password" name="pass" maxlength="30" value="<?php echo $form->value("pass"); ?>"></td><td><?php echo $form->error("pass"); ?></td></tr>
<tr> 

<input type="hidden" name="sublogin" value="1">
<input type="submit" value="Login"></td></tr>
<tr><td colspan="2" align="left"><br><font size="2">[<a href="forgotpass.php">Zapomniales hasla?</a>]</font></td><td align="right"></td></tr>
<tr><td colspan="2" align="left"><br>Nie masz konta? <a href="register.php">Zarejestruj sie!</a></td></tr>
</table>
</form>

<?php
}

echo "</td></tr><tr><td align=\"center\"><br><br>";




?>


</td></tr>
</table>


</body>
</html>
